package test3;

public class Demo {
    public static void main(String[] args) {
        Person person=new Person(123456,"张三");
        Person person1=new Person(123456,"李四");
        System.out.println( person1.compareTo(person));
    }
}
class Person{
    int number;
    String name;
    public Person(int number,String name){
        this.number=number;
        this.name=name;
    }
    public boolean compareTo(Person p) {

        return this.number == p.number;
    }

}
